package com.wman.mvvm;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.wman.R;

import androidx.appcompat.app.AppCompatActivity;

/**
 * 主流上理解的MVP是在代码结构上对C进行了拆分
 * MVC 同样可以分开
 */
public class MvvmActivity extends AppCompatActivity {
    private TextView mTv1, mTv2;
    private Button mButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mTv1 = findViewById(R.id.textView);
        mTv2 = findViewById(R.id.textView2);
        mButton = findViewById(R.id.button);

        new ViewModel(new ViewBinder(), mTv1, mTv2).load();

        mButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                
            }
        });
    }
}
